<script type="text/javascript">
	$.metadata.setType("attr", "validate");
	$().ready(function() {
		$("#add").validate();
	});
</script>

<!-- phần nội dung quản lý - bên phải -->
<div id="content-right">
	<div id="add-product">
		<div id="sidebar-top-product" class="black">
			<div id="img-product" class="left white">
				 <?php echo $title?>
			</div>
			<div id="img-back" class="right white">
				<a class="white" href="javascript:;" onclick="history.go(-1)">Quay lại trang trước</a> 
			</div>
			<div class="clear">
			</div>
		</div>
		<div class="form-product">
			<form action="" method="post" name="add" id="add">
				<?php foreach ($admin_menu_edit as $edit){?>
					<div class="form-add">
						<label class="left black">Chọn danh mục cha</label>
						<select class="selectText" name="cat_id">
							<option value="" disable="disable">-----------------------------</option>
							<option value="0" <?php if ($edit['cat_id'] == 0) echo 'selected=selected'?>>Danh mục cha</option>
							<?php foreach ($menu_admin as $menu){?>
								<option value="<?php echo $menu['id']?>" <?php if ($menu['id'] == $edit['cat_id']) echo 'selected=selected'?>><?php echo $menu['name']?></option>
							<?php }?>
						</select>
					</div>
					<div class="form-add">
						<label class="left black">Tên Menu User </label>
						<input type="text" name="name" class="required" value="<?php echo $edit['name']?>" />
					</div>
					<div class="form-add">
						<label class="left black">Ảnh</label>
						<input placeholder="Chọn ảnh" name="image" type="text" id="image" class="required" value="<?php echo $edit['image']?>" />
						<a onclick="JavaScript:OpenFileManager('image','category');" href="javascript:"><b style="color:blue;">Chọn ảnh</b></a>
					</div>
					<div class="form-add">
						<label class="left black">Menu Header</label>
						<input type="checkbox" class="required" name="is_header" <?php if ($edit['is_header'] == 1) echo 'checked=checked';?> />
					</div>
					<div class="form-add">
						<label class="left black">Hiển thị trang chủ</label>
						<input type="checkbox" class="required" name="is_frontpage" <?php if ($edit['is_frontpage'] == 1) echo 'checked=checked';?> />
					</div>
					<div class="form-add">
						<label class="left black">Hiển thị vị trí</label>
						<div class="check-option">
							<ul>
								<li><input type="radio" name="position" value="1" <?php if ($edit['position'] == 1) echo 'checked=checked';?> /> 1</li>
								<li><input type="radio" name="position" value="2" <?php if ($edit['position'] == 2) echo 'checked=checked';?> /> 2</li>
								<li><input type="radio" name="position" value="3" <?php if ($edit['position'] == 3) echo 'checked=checked';?> /> 3</li>
								<li><input type="radio" name="position" value="4" <?php if ($edit['position'] == 4) echo 'checked=checked';?> /> 4</li>
								<li><input type="radio" name="position" value="5" <?php if ($edit['position'] == 5) echo 'checked=checked';?> /> 5</li>
							</ul>
						</div>
					</div>
					<div class="clear"></div>
					<div class="form-add">
						<label class="left black">Hiển thị</label>
						<div class="check-option">
							<ul>
								<li><input type="radio" name="status" value="1" <?php if ($edit['status'] == 1) echo 'checked=checked';?> /> Yes</li>
								<li><input type="radio" name="status" value="0" <?php if ($edit['status'] == 0) echo 'checked=checked';?> /> No</li>
							</ul>
						</div>
					</div>
				<?php }?>
				<div class="clear"></div>
				<div class="button-product">
					<input type="submit" class="submit-product" name="cmd" value="Update" style="color: #FFF; font-weight: bold; padding-bottom: 5px;" />
					<input type="reset" class="reset-product"  value='Cancel' style="color: #FFF; font-weight: bold; padding-bottom: 5px;" />
				</div>
				<div class="clear"></div>
			</form>                  
		</div>
	</div>
</div><!-- end  content-right -->